<?php

require_once 'Zend/Loader/Autoloader.php';
require_once 'Zend/Session.php';


class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    protected function _initConfiguration()
    {
        Zend_Session::start();
        
        $autoloader = Zend_Loader_Autoloader::getInstance();
        $autoloader->setFallbackAutoloader(true);

        $config = new Zend_Config_Ini('../application/configs/db_config.ini', 'production');
        $registry = Zend_Registry::getInstance();
        $registry->set('db_config',$config);
        $db_config = Zend_Registry::get('db_config');
        $db = Zend_Db::factory($db_config->db);
        Zend_Db_Table::setDefaultAdapter($db);

        $static_path ="http://".$_SERVER["HTTP_HOST"]."/public/";
        $db_config = Zend_Registry::get('db_config');


        $mailconfig = new Zend_Config_Ini('../application/configs/mail_config.ini', 'production');
        $registry = Zend_Registry::getInstance();
        $registry->set('static_path',$static_path);
        $registry->set('mail_config',$mailconfig);

        require_once 'Logger/Log.php';
        $_logger = new Rosemoore_Logger();
        $instance = Zend_Registry::getInstance();
        $instance->set('logger', $_logger);

    }
}

